from pyflix.datasets import RatedDataset
tr = RatedDataset('/netflix/database/training_set')
ratings = [0]*6
for mid, uid, r in tr.iterMovieIDsUserIDsRatings():
  ratings[r] += 1
for i in range(1,6):
  print i, ratings[i]
